Skip to content

Conversation

@0xMink
Copy link
Contributor

@0xMink 0xMink commented Feb 9, 2026

Summary

  • Consolidate three separate this.getState().then(...) calls into a single await this.getState() with destructuring in resolveWebviewView()
  • Eliminates two redundant executions of getState() which includes CloudService calls, ContextProxy reads, and other work
  • Uses a single snapshot, avoiding potential inconsistency if settings change mid-resolution
  • No behavioral change — same defaults, same setter calls, same values

Closes: #11319

Test plan

  • Existing ClineProvider.spec.ts tests pass (90/90, 6 skipped unchanged)
  • Verify terminal settings (shell integration timeout, command delay, zsh options) are applied correctly on webview load
  • Verify TTS enabled/speed settings are applied correctly on webview load

Important

Refactor resolveWebviewView in ClineProvider.ts to consolidate multiple getState calls into a single call, improving performance and consistency without changing behavior.

  • Refactor:
    • Consolidate three this.getState().then(...) calls into a single await this.getState() in resolveWebviewView() in ClineProvider.ts.
    • Use destructuring to extract state values in one go, reducing redundant getState() executions.
    • Maintain same defaults, setter calls, and values, ensuring no behavioral change.
  • Performance:
    • Eliminates redundant CloudService calls and ContextProxy reads by using a single state snapshot.
    • Avoids potential inconsistencies if settings change during multiple getState() calls.

This description was created by Ellipsis for 5519dcd. You can customize this summary. It will automatically update as commits are pushed.

Replace three separate this.getState().then() calls with a single
await this.getState() and destructuring. This avoids running the
full getState() method (CloudService calls, ContextProxy reads, etc.)
three times during webview view resolution.
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 9, 2026
@roomote
Copy link
Contributor

roomote bot commented Feb 9, 2026

Rooviewer Clock   See task

No issues found. The latest commit reverts from blocking await to a non-blocking .then() pattern, which preserves the original non-blocking behavior from main while still consolidating the three getState() calls into one. Defaults, setters, and types are all correct.

Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 9, 2026
@daniel-lxs
Copy link
Member

Thank you!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 9, 2026
@daniel-lxs daniel-lxs merged commit 2789bab into RooCodeInc:main Feb 9, 2026
13 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PERF] resolveWebviewView triggers redundant getState() calls (x3)

2 participants